#!/bin/bash

# 删除普通用户
#users=grep "/bin/bash" /etc/passwd |grep-v "root" | cut -d ":" -f 1
users=`grep "/bin/bash" /etc/passwd |grep -v "root" |grep -v "centos8"|cut -d ":" -f 1`
echo $users
for user in $users
do
	echo "删除$user"
	userdel -r $user
	if [ $? -eq 0 ]
	then
		echo "删除$user成功"
	fi
done
